package com.ktjiaoyu.controller;
import com.ktjiaoyu.entity.SysUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("sub")
public class RegisterController  {
    private static final Logger LOGGER = LoggerFactory.getLogger(HelloController.class);

    @RequestMapping("/register")
    protected String handleRequestInternal() throws Exception {
        return "register";
    }


    @RequestMapping("/model")
    public String model(Model model,
                        @RequestParam(name = "account", required = false) String account,
                        @RequestParam(name = "password", required = false) String password) throws Exception {
        LOGGER.info("恭喜{},注册成功,密码: {}", account, password);
        model.addAttribute("account", account);
        model.addAttribute("password", password);
        return "login";
    }
}
